package com.zlj.web.listener;

import javax.servlet.ServletContextAttributeEvent;
import javax.servlet.ServletContextAttributeListener;
import javax.servlet.annotation.WebListener;

@WebListener
public class BListener implements ServletContextAttributeListener {
    public void attributeAdded(ServletContextAttributeEvent sca)  { 
         System.out.println("您向application中添加了名为：" + sca.getName() + ",值为：" + sca.getValue());
    }

    public void attributeRemoved(ServletContextAttributeEvent sca)  { 
        System.out.println("您移除了名为：" + sca.getName() + ",值为：" + sca.getValue());
    }

    public void attributeReplaced(ServletContextAttributeEvent sca)  { 
         System.out.println("您替换了：" + sca.getName() + ",值为：" + sca.getValue() + "新的值为：" + sca.getServletContext().getAttribute(sca.getName()));
    }
	
}
